<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
	<meta charset="utf-8"> 
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=500" />
	<meta name="keywords" content="ScrollMagic, example, scrolling, attaching, scrollbar, tween, tweenmax" />
	<meta name="author"	content="Jan Paepke (www.janpaepke.de)" />
	<title>Parallax Sections - Examples - ScrollMagic</title>

	<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic|Josefin+Slab:400,700italic' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="../../assets/css/normalize.css" type="text/css">
	<link rel="stylesheet" href="../../assets/css/style.css" type="text/css">
	<link rel="stylesheet" href="../../assets/css/examples.css" type="text/css">
	<link rel="shortcut icon" href="../../assets/img/favicon.ico" type="image/x-icon">

	<script type="text/javascript" src="../../assets/js/lib/jquery.min.js"></script>
	<script type="text/javascript" src="../../assets/js/lib/highlight.pack.js"></script>
	<script type="text/javascript" src="../../assets/js/lib/modernizr.custom.min.js"></script>
	<script type="text/javascript" src="../../assets/js/examples.js"></script>
	
	<script type="text/javascript" src="../../assets/js/lib/gsap3/gsap.min.js"></script>
	<script type="text/javascript" src="../../scrollmagic/uncompressed/ScrollMagic.js"></script>
  <script type="text/javascript" src="../../scrollmagic/uncompressed/plugins/animation.gsap.js"></script>
	<script type="text/javascript" src="../../scrollmagic/uncompressed/plugins/debug.addIndicators.js"></script>
</head>
<body>
	<ul id="menu"></ul>
	<div id="content-wrapper">
		<div id="example-wrapper">
			<div class="scrollContent">
				<section id="titlechart">
					<div id="description">
						<h1 class="badge gsap">Parallax Sections</h1>
						<h2>The most common parallax application</h2>
						<p>
							To create a classic parallax page effect simply add elements that contain the parallax background.<br>
							Then use scenes to animate the child element's position.
						</p>
						<p>
							The DOM is very straight forward and consists of consecutive containers.
						</p>
						<a href="#" class="viewsource">view source</a>
					</div>
				</section>
				<section class="demo">
					<style type="text/css">
						.parallaxParent {
							height: 100vh;
							overflow: hidden;
						}
						.parallaxParent > * {
							height: 200%;
							position: relative;
							top: -100%;
						}
					</style>
					<div class="spacer s0"></div>
					<div id="parallax1" class="parallaxParent">
						<div style="background-image: url(../../assets/img/example_parallax_bg1.png);"></div>
					</div>
					<div class="spacer s1">
						<div class="box2 blue">
							<p>Content 1</p>
							<a href="#" class="viewsource">view source</a>
						</div>
					</div>
					<div class="spacer s0"></div>
					<div id="parallax2" class="parallaxParent">
						<div style="background-image: url(../../assets/img/example_parallax_bg2.png);"></div>
					</div>
					<div class="spacer s1">
						<div class="box2 blue">
							<p>Content 2</p>
							<a href="#" class="viewsource">view source</a>
						</div>
					</div>
					<div class="spacer s0"></div>
					<div id="parallax3" class="parallaxParent">
						<div style="background-image: url(../../assets/img/example_parallax_bg3.png);"></div>
					</div>
					<div class="spacer s2"></div>
					<script>
						// init controller
						var controller = new ScrollMagic.Controller({globalSceneOptions: {triggerHook: "onEnter", duration: "200%"}});

						// build scenes
						new ScrollMagic.Scene({triggerElement: "#parallax1"})
										.setTween("#parallax1 > div", {y: "80%", ease: Linear.easeNone})
										.addIndicators()
										.addTo(controller);

						new ScrollMagic.Scene({triggerElement: "#parallax2"})
										.setTween("#parallax2 > div", {y: "80%", ease: Linear.easeNone})
										.addIndicators()
										.addTo(controller);

						new ScrollMagic.Scene({triggerElement: "#parallax3"})
										.setTween("#parallax3 > div", {y: "80%", ease: Linear.easeNone})
										.addIndicators()
										.addTo(controller);
					</script>
				</section>
				<div class="spacer s_viewport"></div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="../../assets/js/tracking.js"></script>
</body>
</html>
